#include    "UserCommand.h"

// File [alfs/gui/UserCommand.cpp].
//
// UserCommand
//
// A UserCommand represents some user action (e.g. button or menu action) abstractly,
// without a binding to any internal program action.  It provides the information needed
// to present the action to the user, including an id that can be used for national
// language resource retrieval.  It provides a set of standard id's for common actions.
//
// (c) copyright Alf P. Steinbach 2008.
// Use, modification and distribution are subject to the "New BSD License"
// as listed at <url: http://www.opensource.org/licenses/bsd-license.php>.

#if 0
#include    "impl_wxWidgets/UserCommand__id_values.cpp"
#endif

namespace alfs{

#   define  ThisClass   UserCommand

    ThisClass::~ThisClass() {}

    ThisClass::ThisClass()
        : myId( null ), myDefaultText()
    {
        assertInvariant();
    }

    ThisClass::ThisClass( Id id, std::wstring const& defaultText )
        : myId( id ), myDefaultText( defaultText )
    {
        assertInvariant();
    }

    ThisClass::ThisClass( std::wstring const& defaultText )
        : myId( newId() ), myDefaultText( defaultText )
    {
        assertInvariant();
    }

    ThisClass::Id ThisClass::id() const
    {
        return myId;
    }

    std::wstring ThisClass::text() const
    {
        return myDefaultText;
    }

    bool ThisClass::operator<( UserCommand const& other ) const
    {
        return id() < other.id();
    }

    bool ThisClass::operator==( UserCommand const& other ) const
    {
        return id() == other.id();
    }

#undef  ThisClass

}  // alfs
